<!--
  Generated template for the AccountManagePage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
    <ion-title>账户管理</ion-title>
    <ion-buttons end>
      <button class="btn-header-right" color="light-blue" ion-button (click)="showAddPage()">
        <ion-icon name="add-circle"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>

</ion-header>


<ion-content>
  <ion-refresher (ionRefresh)="doRefresh()">
    <ion-refresher-content></ion-refresher-content>
  </ion-refresher>
  <ion-list>
    <ion-item-sliding *ngFor="let item of dataList;let i = index;">
      <ion-item>
        <!--<ion-avatar item-start>-->
        <!--<img src="assets/img/avatar-ts-buzz.png">-->
        <!--</ion-avatar>-->
        <P>姓&nbsp;&nbsp;&nbsp;名：{{item.name}}</P>
        <p>手机号：{{item.phonenum}}</p>
        <p>登录名：{{item.username}}</p>

        <ion-note item-end *ngIf="item.roletype==='BOSS'" style="color: #66ccff">老&nbsp;&nbsp;&nbsp;板</ion-note>
        <ion-note item-end *ngIf="item.roletype==='ADMIN'" style="color: hotpink;">管理员</ion-note>
        <ion-note item-end *ngIf="item.roletype==='CUSTOMER'">用&nbsp;&nbsp;&nbsp;户</ion-note>
        <ion-note item-end *ngIf="item.roletype==='STAFF'" style="color: #66ccff">员&nbsp;&nbsp;&nbsp;工</ion-note>

      </ion-item>
      <ion-item-options side="right">
        <button ion-button color="danger" (click)="deleteUser(item.userid,i)">
          <ion-icon name="trash"></ion-icon>
          删除
        </button>
        <button ion-button color="primary" (click)="editUser(item)">
          <ion-icon name="alert"></ion-icon>
          修改
        </button>
      </ion-item-options>
    </ion-item-sliding>
  </ion-list>
  <ion-infinite-scroll (ionInfinite)="$event.waitFor(doInfinite())">
    <ion-infinite-scroll-content loadingSpinner="bubbles"
                                 loadingText="正在加载下一页...">>

    </ion-infinite-scroll-content>
  </ion-infinite-scroll>
  <div style="text-align: center;color: gray;" *ngIf="page.isLastPage">- - - - - - - - - - 到底啦 - - - - - - - - - -</div>
</ion-content>
